<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>内容过滤器</title>
	<script type="text/javascript" src="./jquery-3.1.1.js"></script>
	<style type="text/css" media="screen">
		p{
			height: 20px;
			border: 1px solid purple;
		}
		
	</style>
</head>
<body>
	<table border="1">
		<tr>
			<th>姓名</th>
			<th>性别</th>
			<th>年龄</th>
		</tr>	
		<tr>
			<td>马云</td>
			<td>男</td>
			<td>26</td>
		</tr>
		<tr>
			<td>奶茶妹</td>
			<td>女</td>
			<td>23</td>
		</tr>
		<tr>
			<td>刘强东</td>
			<td>男</td>
			<td>25</td>
		</tr>
		<tr>
			<td>金星</td>
			<td></td>
			<td><span>22</span></td>
		</tr>
	</table>

	<p><br /></p>
	<p>a</p>
	<p></p>
</body>
<script type="text/javascript">
	//找td中含有'女'字的
	$('td:contains(女)').css('background','purple');
	//找td中为空
	$('td:empty').css('background','silver');
	//找出不为空的p标签(p标签下没有内容的)
	$('p:parent').css('background','olive');
	//找出td下含有span标签的
	$('td:has(span)').css('background','maroon');
</script>
</html>